/*
 * Reward.h
 *
 *  Created on: 2013. 11. 1.
 *      Author: the2
 */

#ifndef REWARD_H_
#define REWARD_H_

#include <vector>
#include <ctime>

namespace ProjectZ {
class User;
} /*ProjectZ*/

namespace ProjectZ {
namespace NLogic {

class Reward {
public:
	enum RewardType : int
	{
		__NONE__ = -1,

		DAILY_PET_REWARD = 0,
		FRIENDSHIP_BOX_REWARD,
		DAILY_PAIRY_REWARD,
		DAILY_ATTENDANCE_REWARD,
		LAST_WEEK_RANK_REWARD,
		LAST_WEEK_RANK_FRIEND,
		CONNECT_EVENT,

		__MAX__,
	};

	struct Data
	{
		int _value;
		int _subValue;

		// 설계 이후 DB 컬럼 사이즈 변경으로 사용 못하게 됨 start..	//
//		time_t _rewardReceiveTime;							//
//		int _myRanking;										//
//		int _lastWeekFriendCount;							//
		// end..											//

		Data() : _value(0), _subValue(0){}//, _rewardReceiveTime(0), _myRanking(0), _lastWeekFriendCount(0) {}

		void Clear()
		{
			_value = 0;
			_subValue = 0;
//			_rewardReceiveTime = 0;
//			_myRanking = 0;
//			_lastWeekFriendCount = 0;
		}
	};

public:
	Reward(User * pUser);
	virtual ~Reward();

	void Initialize();
	void Finalize();

//	void SetLastLoginTime(time_t lastLoginTime);// { _lastLoginTime = lastLoginTime; }

	void load_Reward();
	void save_Reward();

	Data * GetData(int rewardType);

typedef std::vector<Data *> REWARDVECTOR;

	REWARDVECTOR & GetRewardVector() { return _clsRewardVector; }

private:
	User * _user;
	time_t _lastLoginTime;
	REWARDVECTOR _clsRewardVector;
};

} /* namespace NLogic */
} /* namespace ProjectZ */

#endif /* REWARD_H_ */
